---
apiVersion: v1
kind: ConfigMap
metadata:
  name: prometheus-config
  namespace: monitoring
data:
  prometheus.yml: |
    global:
      scrape_interval:     15s
      external_labels:
        monitor: 'k8s-dev-monitor'
    remote_write:
      - url: http://victoriametrics-sys-connect:8428/api/v1/write
    scrape_configs:

      #=========================================================================
      - job_name: 'kube-controller'
        #honor_labels: true
        kubernetes_sd_configs:
        - role: pod
          namespaces:
            names:
            - kube-system
        scheme: https
        tls_config:
          ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
          insecure_skip_verify: true
        bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
        relabel_configs:
        - source_labels: [__meta_kubernetes_pod_name]
          action: keep
          regex: 'kube-controller-.*'
        - source_labels: [__address__]
          action: replace
          target_label: __address__
          regex: (.+?)(\\:\\d+)?
          replacement: $1:10257
